#include <iostream>
using namespace std;

int a[350];
int size;
int S[1005];

int getf(int x) {
	if (S[x] == x) {
		return x;
	}
	return S[x] = getf(S[x]);
}

void merge(int x, int y) {
	int u = getf(x), v = getf(y);
	if (u != v) {
		S[x] = v;
		S[u] = v;
	}
}

void power2() {
	bool add = 0;
	for (int i = 1; i <= size; ++i) {
		a[i] *= 2;
		if (add) {
			++a[i];
			add = 0;
		}
		if (a[i] >= 10) {
			a[i] -= 10;
			add = 1;
		}
	}
	if (add) {
		a[++size] = 1;
	}
}

void output() {
	for (int i = size; i > 0; --i) {
		cout << a[i];
	}
	cout << endl;
}

int main() {
	size = 1;
	a[1] = 1;
	int n, m, a, b;
	cin >> n >> m;

	for (int i = 0; i <= n; ++i) {
		S[i] = i;
	}

	for (int i = 1; i <= m; ++i) {
		cin >> a >> b;
		merge(a, b);
	}

	for (int i = 1; i <= n; ++i) {
		if (S[i] != i) power2();
	}

	output();
	return 0;
}